#include <assert.h>

#include "Screen.h"
#include <gl\glut.h>

Screen::Screen()
{
	SDL_Init(SDL_INIT_EVERYTHING);
	m_surface = 0;
}

Screen::~Screen()
{
//	SDL_Quit();
}

bool Screen::CreateWindow(int width, int height) 
{
	m_surface = SDL_SetVideoMode(width, height, 0, SDL_OPENGL | SDL_HWSURFACE);
	SCREENSIZE.X = width;
	SCREENSIZE.Y = height;
	SCREENRATIO = width / height;

	return (m_surface != 0);
}

void Screen::Flip()
{
	assert(m_surface != 0);
	SDL_GL_SwapBuffers();
}

SDL_Surface* Screen::GetSurface()
{
	assert(m_surface);
	return m_surface;
}